-
Java Convert File to String
In Java, we have many ways to convert a File to a String.
Date: 2019-08-11 View: 1520
-
Java 8 Should we close the Stream after use?
Only Streams whose source are an IO channel like Files.lines(Path, Charset) need to be closed.
Date: 2019-08-11 View: 1520
-
Java How to change date format in a String
If Java 8, DateTimeFormatter, else SimpleDateFormat to change the date format in a String.
Date: 2019-08-11 View: 1520
-
Java 8 Convert LocalDateTime to Timestamp
In Java, we can use Timestamp.valueOf(LocalDateTime) to convert a LocalDateTime into a Timestamp.
Date: 2019-08-11 View: 1520
-
Java 8 Stream The peek() is not working with count()?
Many examples are using the .count() as the terminal operation for .peek(), for example:
Date: 2019-08-11 View: 1520
-
Java 8 Convert ZonedDateTime to Timestamp
Java example to convert java.time.ZonedDateTime to java.sql.Timestamp and vice verse.
Date: 2019-08-11 View: 1520
-
Java Prime Numbers examples
The following Java examples will print a list of all the prime numbers up to 1,000:
Date: 2019-08-11 View: 1520
-
Java 8 Parallel Streams Examples
Few Java 8 examples to execute streams in parallel.
Date: 2019-08-11 View: 1520
-
How to loop an enum in Java
Call the .values() method of the enum class to return an array, and loop it with the for loop:
Date: 2019-08-11 View: 1520
-
Java 8 Stream Convert List<List<String>> to List<String>
As title, we can use flatMap to convert it.
Date: 2019-08-11 View: 1520
-
Java Regular Expression Examples
Java 8 stream and regular expression examples.
Date: 2019-08-11 View: 1520